TableGetMinFromCol Function

public function TableGetMinFromCol(tab, id) result(min)

return the minimum value of a column given the column header

Arguments

Type IntentOptional Attributes Name
type(Table), intent(in) :: tab
character(len=*), intent(in) :: id

header id

Return Value real(kind=float)


Variables

Type Visibility Attributes Name Initial
type(Column), public :: col
integer, public :: i
real(kind=float), public :: number

Source Code

FUNCTION TableGetMinFromCol &
!
( tab, id ) &
!
RESULT (min)

! Module used:
USE StringManipulation, ONLY: &
! imported routines:
StringToFloat

IMPLICIT NONE

!arguments with intent (in):
TYPE (table), INTENT (IN) :: tab
CHARACTER (LEN = *),  INTENT (IN) :: id !! header id

!local dclarations:
REAL (KIND = float) :: min, number
TYPE (Column) :: col
INTEGER :: i
!--------------------------------end of declarations---------------------------

!get the column
col = TableGetColByHeader (tab, id)

min = HUGE (min)

DO i = 1, SIZE (col % row)
    number = StringToFloat ( col % row (i) )
    IF ( number < min ) THEN
        min = number
    END IF
END DO

RETURN

END FUNCTION TableGetMinFromCol